<!doctype html>
<html manifest="/security/powerfulFeatureRestrictions/resources/simple.manifest">
<head>
<title>Old Powerful Features on an Insecure Origin</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/get-host-info.js"></script>
</head>
<body>
<div id="target"></div>
<script>
if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
    window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.pathname;
} else {
    if (!window.internals)
        assert_unreached('window.internals is required for this test');

    // Tests for APIs that have been turned off on insecure origins
    async_test(function() {
        navigator.geolocation.getCurrentPosition(
            this.unreached_func('getCurrentPosition should fail, but succeeded.'),
            this.step_func_done(function(error) {
                assert_equals(error.code, error.PERMISSION_DENIED);
            }));
    }, 'getCurrentPosition');

    // Note that the deprecation message for watchPosition() will be suppressed
    // because it is an exact duplicate of the getCurrentPosition() message.
    // Thus, this test is really to confirm that it still executes (and fails).
    async_test(function() {
        navigator.geolocation.watchPosition(
            this.unreached_func('watchPosition should fail, but succeeded.'),
            this.step_func_done(function(error) {
                assert_equals(error.code, error.PERMISSION_DENIED);
            }));
    }, 'watchPosition');

    test(function() {
        assert_false('webkitGetUserMedia' in navigator);
        assert_false('getUserMedia' in navigator);
        assert_false('mediaDevices' in navigator);
    }, 'Media devices properties');

    test(function() {
      assert_false('requestMediaKeySystemAccess' in navigator);
    }, 'requestMediaKeySystemAccess');
}
</script>
</body>
</html>
